{if $first_time}
<div class="welcome">Регистрация практически закончена. Пожалуйста напишите нам пару слов о себе.</div>
{/if}
<form action="{Request::cUrl('action=profile_save')}" method="post">
	<input type="hidden" name="user[id]" id="user[id]" value="{$user->id}" />
	<table>
		{foreach $properties as $property}
			<tr class="property_{$property->name}">
				<td style="text-align: right">
					<label for="property_{$property->name}">{$property->title}{if $property->required}&nbsp;<sup class="required">*</sup>{/if}</label>
				</td>
				<td>
					{if $property->type == UsersProperties::TYPE_TEXT}
						<input name="user[UserData][{$property->id}]" type="text" id="property_{$property->name}" value="{if ($user->property($property->name))}{$user->property($property->name)}{elseif !empty($property->default_value)}{$property->default_value}{/if}"/>
						
					{elseif $property->type == UsersProperties::TYPE_CHECKBOX}
						<input name="user[UserData][{$property->id}]" type="checkbox" id="property_{$property->name}" value="1"{if (($user->property($property->name)) && $user->property($property->name) == 1) || (!empty($property->default_value) && $property->default_value == 1)} checked{/if}/>
						
					{elseif $property->type == UsersProperties::TYPE_INT}
						<input name="user[UserData][{$property->id}]" type="text" id="property_{$property->name}" value="{if ($user->property($property->name))}{$user->property($property->name)}{elseif !empty($property->default_value)}{$property->default_value}{/if}"/>
						
					{elseif $property->type == UsersProperties::TYPE_TIMESTAMP}
						<input name="user[UserData][{$property->id}]" type="text" id="property_{$property->name}" value="{if ($user->property($property->name))}{$user->property($property->name)}{elseif !empty($property->default_value)}{$property->default_value}{/if}"/>
						
					{elseif $property->type == UsersProperties::TYPE_URL}
						<input name="user[UserData][{$property->id}]" type="text" id="property_{$property->name}" value="{if ($user->property($property->name))}{$user->property($property->name)}{elseif !empty($property->default_value)}{$property->default_value}{/if}"/>
						
					{elseif $property->type == UsersProperties::TYPE_EMAIL}
						<input name="user[UserData][{$property->id}]" type="text" id="property_{$property->name}" value="{if ($user->property($property->name))}{$user->property($property->name)}{elseif !empty($property->default_value)}{$property->default_value}{/if}"/>
						
					{/if}
				</td>
			</tr>
		{/foreach}
	</table>
	
	<input type="submit" value="Сохранить" />
</form>